import { forwardRef, Inject, Injectable } from "@nestjs/common";
import { EnumMicroService, SysIntervalMsgType } from "../../../types/types";
import { ClientProxy } from "@nestjs/microservices";
import { configuration } from "../../../config/config";
import { NatsClientService } from "@app/nats-client";

@Injectable()
export class HardwareService {
  ready: boolean = false;
  @Inject(NatsClientService)
  private natsGatewayClient: NatsClientService;
  constructor() {}

  getHello(): string {
    return "Hello World!";
  }

  broadcastMsg(msg) {
    this.natsGatewayClient.emit(
      SysIntervalMsgType.RECEIVE_HARDWARE_MSG_EVENT,
      msg,
    );
  }
}
